import React, { useEffect } from "react";
import { useNavigate } from "react-router-dom";

function useArry() {
  const nav = useNavigate();
  useEffect(() => {
    const token = localStorage.getItem("token");
    if (!token) {
      nav("/login");
    }
  }, []);
}

export default useArry;
